﻿<Window x:Class="WindowSettings"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:settings="clr-namespace:Video_Controller"
    Title="Settings" SizeToContent="WidthAndHeight"
        Background="{DynamicResource WindowBackgroundBrush}" ResizeMode="NoResize" WindowStyle="ToolWindow">
    <Grid>
        <StackPanel>
        <StackPanel Orientation="Horizontal">
            <Border BorderThickness="0.5" Margin="4" CornerRadius="5" >
                <StackPanel>
                    <Label Content="RS-232 Settings  " />
                    <Separator/>
                        <Label Content="Com Port" />
                        <ComboBox Name="cmbCOMPort" SelectedValuePath="Content" SelectedValue="{Binding Source={x:Static settings:MySettings.Default},Path=ComPort, Mode=TwoWay}" />
                        <Label Content="Baud Rate" />
                        <ComboBox  Name="cmbBaudRate" SelectedValuePath="Content" SelectedValue="{Binding Source={x:Static settings:MySettings.Default},Path=BaudRate, Mode=TwoWay}">
                            <ComboBoxItem Content="100" />
                            <ComboBoxItem Content="300" />
                            <ComboBoxItem Content="1200" />
                            <ComboBoxItem Content="2400" />
                            <ComboBoxItem Content="4800" />
                            <ComboBoxItem Content="9600" />
                            <ComboBoxItem Content="38400" />
                            <ComboBoxItem Content="57600" />
                            <ComboBoxItem Content="115200" />
                            <ComboBoxItem Content="230400" />
                            <ComboBoxItem Content="460800" />
                            <ComboBoxItem Content="921600" />
                        </ComboBox>
                        <Label Content="Data Bits"  />
                        <ComboBox  Name="cmbDataBits" SelectedValuePath="Content" SelectedValue="{Binding Source={x:Static settings:MySettings.Default},Path=DataBits, Mode=TwoWay}">
                        <ComboBoxItem Content="5" />
                            <ComboBoxItem Content="6" />
                            <ComboBoxItem Content="7" />
                            <ComboBoxItem Content="8" />
                        </ComboBox>
                        <Label Content="Parity" />
                        <ComboBox  Name="cmbParity" SelectedValuePath="Content" SelectedValue="{Binding Source={x:Static settings:MySettings.Default},Path=Parity, Mode=TwoWay}">
                        <ComboBoxItem Content="Odd" />
                            <ComboBoxItem Content="Even" />
                            <ComboBoxItem Content="None" />
                        </ComboBox>
                        <Label Content="Stop Bit" />
                        <ComboBox  Name="cmbStopBit" SelectedValuePath="Content" SelectedValue="{Binding Source={x:Static settings:MySettings.Default},Path=StopBit, Mode=TwoWay}">
                       <ComboBoxItem Content="One" />
                          <ComboBoxItem Content="OnePointFive" />  
                            <ComboBoxItem Content="Two" />
                        </ComboBox>
                        <Label Content="Address" />
                    <ComboBox SelectedValuePath="Content" SelectedValue="{Binding Source={x:Static settings:MySettings.Default},Path=DeviceAddress, Mode=TwoWay}">
                        <ComboBoxItem Content="00" />
                        <ComboBoxItem Content="01" />
                        <ComboBoxItem Content="02" />
                        <ComboBoxItem Content="03" />
                        <ComboBoxItem Content="04" />
                        <ComboBoxItem Content="05" />
                        <ComboBoxItem Content="06" />
                        <ComboBoxItem Content="07" />
                        <ComboBoxItem Content="08" />
                        <ComboBoxItem Content="09" />
                        <ComboBoxItem Content="0A" />
                        <ComboBoxItem Content="0B" />
                        <ComboBoxItem Content="0C" />
                        <ComboBoxItem Content="0D" />
                        <ComboBoxItem Content="0E" />
                        <ComboBoxItem Content="0F" />
                    </ComboBox>
                </StackPanel>
            </Border>
            <Border BorderThickness="0.5" Margin="4" CornerRadius="5" >
            <StackPanel>

                        <Label Content="Inputs" />
                        <Separator/>
                        <Label Content="Input 1" />
                <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Input1, Mode=TwoWay}" />
                    <Label Content="Input 2" />
                <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Input2, Mode=TwoWay}" />
                        <Label Content="Input 3" />
                <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Input3, Mode=TwoWay}" />
                        <Label Content="Input 4" />
                <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Input4, Mode=TwoWay}" />
                        <Label Content="Input 5" />
                <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Input5, Mode=TwoWay}" />
                        <Label Content="Input 6" />
                <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Input6, Mode=TwoWay}" />
                        <Label Content="Input 7" />
                <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Input7, Mode=TwoWay}" />
                        <Label Content="Input 8" />
                <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Input8, Mode=TwoWay}" />
               

 
        </StackPanel>
            </Border>
            <Border BorderThickness="0.5" Margin="4" CornerRadius="5" >
                <StackPanel>
                        <Label Content="Outputs" />
                        <Separator/>
                        <Label Content="Output 1" />
                    <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Output1, Mode=TwoWay}" />
                    <Label Content="Output 2" />
                    <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Output2, Mode=TwoWay}" />
                    <Label Content="Output 3" />
                    <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Output3, Mode=TwoWay}" />
                    <Label Content="Output 4" />
                    <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Output4, Mode=TwoWay}" />
                    <Label Content="Output 5" />
                    <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Output5, Mode=TwoWay}" />
                    <Label Content="Output 6" />
                    <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Output6, Mode=TwoWay}" />
                    <Label Content="Output 7" />
                    <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Output7, Mode=TwoWay}" />
                    <Label Content="Output 8" />
                    <TextBox Text="{Binding Source={x:Static settings:MySettings.Default},Path=Output8, Mode=TwoWay}" />



                </StackPanel>
            </Border>
        </StackPanel>
        <Button Name="btnSaveSettings" Content="Save and Close " Click="btnSaveSettings_Click"/>
        </StackPanel>
    </Grid>
</Window>
